Day 11 - Find and replace text
39
Exercise 11.01
Using grep and wc, count how many times the file examples.txt contains the word dog
Go to solution
Exercise 11.02
Print all the lines of examples.txt that do not contain either a lowercase or an uppercase h
Go to solution
Exercise 11.03
Replace all letters e in the file examples.txt with a question mark ?, then find among the resulting
lines all the ones that have a space in them
Go to solution
We will meet grep and sed again (and again and again) in the book and basically every time we will
write some script. When we will learn regular expressions they will be back in play, and we will
unleash their true power! Have a nice evening, or, if it’s still morning s,"evening","day",!
Suggested film for the evening: Fantasia (1940) - What else do you think about when you read
“elephants” and “abracadabra”?